//#ifndef STD_H
//#define STD_H
//#include <avr/io.h>
//#include <inttypes.h>
//#endif

#ifndef USART_H
#define USART_H

#ifndef F_CPU
#define F_CPU 32000000
#endif

#define USART_IsRXComplete(_usart) (((_usart)->STATUS & USART_RXCIF_bm) != 0)
#define USART_GetChar(_usart)  ((_usart)->DATA)

void usart_init(PORT_t *port, USART_t *usart, uint32_t baudrate);
void usart_rx_buf_flush(void);
uint8_t usart_rx_buf_has_data(void);
void usart_rx_buf_put_byte(uint8_t data);
uint8_t usart_rx_buf_get_byte(void);
//uint8_t usart_getChar(void);

void usart_send_byte(uint8_t byte);
void usart_send_string(char *byte);
int uart_putchar(char c, FILE *stream);

#endif
